package com.jianganming.proxy.myproxy;

import java.lang.reflect.Method;

public class MyHandler implements MyInvocationHandler {
    private Teacher teacher;

    public MyHandler(Teacher teacher){
        this.teacher=teacher;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("动态代理调用开始");
        Object result = method.invoke(teacher, args);
        System.out.println("动态代理调用结束");
        return result;
    }
}
